﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;


namespace Ramparts
{
    class DyingState : I_State 
    {

        AnimatedSprite animation;
        SpriteBatch spriteBatch;
        GameComponent component;
        public bool stateFinished;

        #region I_State Members

        // Generic Dying Animation State
        // Will play the dying animation and then won't draw anymore
        public DyingState(AnimatedSprite animation, GameComponent component)
        {
            this.animation = animation;
            this.animation.loop = true;
            this.spriteBatch = component.sceneManager.rampart.spriteBatch;
            this.component = component;
            this.animation.playing = false;
        }

        public void begin()
        {
            animation.playing = true;
        }

        public void stop()
        {
            // Do Nothing
        }

        public void update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            animation.Update(gameTime);
            if (!animation.playing)
            {
                stateFinished = true;
            }
        }

        public void draw()
        {
             animation.Draw(component.position);
        }

        public void processMouseEvents()
        {
            // Do Nothing
        }

        public void processKeyboardEvents()
        {
           // Do Nothing
        }

        
        #endregion
    }
}
